<template>
	<view class="qilin-changeCity">
		<change-city-header></change-city-header>
		<change-city-content :citys="allCityDatas" :alpha="currentAlpha"></change-city-content>
		<change-city-alphabet :citys="allCityDatas" @changeCity="changeCity"></change-city-alphabet>
	</view>
</template>

<script>
	import ChangeCityHeader from "../../components/changeCityHeader.vue";
	import ChangeCityContent from "../../components/changeCityContent.vue";
	import ChangeCityAlphabet from "../../components/changeCityAlphabet.vue";
	export default {
		components:{
			ChangeCityHeader,
			ChangeCityContent,
			ChangeCityAlphabet
		},
		data() {
			return {
				allCityDatas:[//所有城市数据
					{
						initial:"A",
						list:[
							{
								name:"安庆",
								value:"anqin"
							},
							{
								name:"安康",
								value:"ankang"
							},
							{
								name:"安阳",
								value:"anyang"
							},
							{
								name:"埃及",
								value:"aiji"
							},
							{
								name:"艾伯利亚",
								value:"aiboliya"
							},
							{
								name:"艾欧尼亚",
								value:"aiouniya"
							}
						]
					},
					{
						initial:"B",
						list:[
							{
								name:"北京",
								value:"beijing"
							},
							{
								name:"北阳",
								value:"beiyang"
							},
							{
								name:"冰岛",
								value:"bingdao"
							},
							{
								name:"北极",
								value:"biji"
							},
							{
								name:"布拉岛",
								value:"buladao"
							}
						]
					},
					{
						initial:"C",
						list:[
							{
								name:"成都",
								value:"chengdu"
							},
							{
								name:"纯阳",
								value:"chunyang"
							},
							{
								name:"春江佳园",
								value:"chunjiajiangyuan"
							},
							{
								name:"春天学府",
								value:"chuntianxuefu"
							}
						]
					},
					{
						initial:"D",
						list:[
							{
								name:"丹阳",
								value:"danyang"
							},
							{
								name:"当涂",
								value:"dangtu"
							},
							{
								name:"杜康",
								value:"dukang"
							},
							{
								name:"杜甫",
								value:"dufu"
							}
						]
					},
					{
						initial:"E",
						list:[
							{
								name:"伊拉克",
								value:"elk"
							},
							{
								name:"伊人岛",
								value:"yirendao"
							},
							{
								name:"伊朗",
								value:"yilang"
							},
							{
								name:"艾斯",
								value:"aisi"
							}
						]
					},
					{
						initial:"F",
						list:[
							{
								name:"凤阳",
								value:"fengyang"
							},
							{
								name:"夫差",
								value:"fuchai"
							},
							{
								name:"夫子",
								value:"fuzi"
							},
							{
								name:"凤翔",
								value:"fengxiang"
							}
						]
					},
					{
						initial:"G",
						list:[
							{
								name:"高淳",
								value:"gaochun"
							},
							{
								name:"高尔夫",
								value:"gaoerfu"
							}
						]
					},
					{
						initial:"H",
						list:[
							{
								name:"韩国",
								value:"hanguo"
							},
							{
								name:"含山",
								value:"hanshan"
							}
						]
					},
					{
						initial:"I",
						list:[
							{
								name:"英国",
								value:"in"
							}
						]
					},
					{
						initial:"J",
						list:[
							{
								name:"济南",
								value:"jinan"
							}
						]
					}
				],
				currentAlpha:"",//当前字母
			}
		},
		methods: {
			changeCity(data){
				// console.log(data);
				this.currentAlpha=data;
			}
		}
	}
</script>

<style>
.qilin-changeCity{
	width:100%;
	height:100%;
}
</style>
